package com.speed_run.controller;


import com.speed_run.service.IUserExerciseData;
import com.speed_run.utils.ResponseEntity;
import com.speed_run.vo.BarVo;
import com.speed_run.vo.ExerciseVo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1/api/user")
public class ExerciseController {

    @Autowired
    private IUserExerciseData service;

    @PostMapping("/exerciseData")
    public ResponseEntity  exerciseData(@RequestBody ExerciseVo vo){
        return  service.addData(vo);
    }
    @GetMapping("/exerciseData")
    public ResponseEntity  getData(String token){
    	return service.getUserExerData(token);
    }

    @GetMapping("/statisticsData")
    public ResponseEntity getStatisticsData(String token){
        return  service.getStatisticsData(token);
    }
    
    @GetMapping("/statisticsBarData")
    public ResponseEntity getStatisticsBarData(BarVo vo){
        return  service.getStatisticsBarData(vo);
    }
    
    @GetMapping("/exerciseDetailData")
    public ResponseEntity  exerciseDetailData(Integer page){
    	return service.exerciseDetailData(page);
    }
}
